package com.heqiang.controller;

import com.heqiang.domain.User;
import com.heqiang.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
@Controller
@RequestMapping("/user")
@Slf4j
public class UserController {

    @Autowired
    private UserService service;

    /****************************************************** Query *****************************************************/
    /**
     * 查询-用户列表
     * zhang he qiang
     * @Date 2020/7/24
     * @Return org.springframework.web.servlet.ModelAndView
     **/
    @RequestMapping("/findAll")
    @ResponseBody
    public List<User> findAll(User user, Model model) {
        log.info("==============查询用户列表=============");
        return service.findAll(user);
    }
}
